<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>原材料类型</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 
  <link rel="stylesheet" href="../../res/css/wholesale/font.css">
  <link rel="stylesheet" href="../../res/css/wholesale/xadmin.css">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="../../res/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../res/js/wholesale/xadmin.js"></script>
</head>
<body>
<div class="demoTable" style="margin-top: 10px;">
 
    <div class="x-body">
      <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
          <input type="text" name="rtName" id="rtName" placeholder="请输入材料类型名称" autocomplete="off" class="layui-input">
          <button class="layui-btn" data-type="reload" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </div>
      </div>
      <xblock>
        <button class="layui-btn" id="insert"><i class="layui-icon"></i>添加</button>
      </xblock>
<table class="layui-table" id="idTest" lay-filter="demo">
   
</table>
 <script type="text/javascript">
layui.use('table',function(){
	  var table = layui.table;
	  var form = layui.form;
	  
	  
	  table.render({
		    elem: '#idTest'
		    ,page: true
		    ,url:'../../listenRawstockType/findRawstockType.action'

		    ,cols: [[
		       {field:'rtId', align:'center'}
		      ,{field:'rtName',title: '原材料类型名称', align:'center'}
		      ,{field:'right',title: '操作', align:'center',templet:'#barDemo'}
		    ]],done: function (res, curr, count) {
	            $("[data-field='rtId']").css('display','none');
		    }
		  });
});
</script>
 </div>
 </div>
 
 

<script type="text/html" id="typeName">
{{# if(d.rtId == d.lisRtId) { }}
     <div>无</div>
 	 {{# } else if(d.rtId != d.lisRtId){ }}
    <div>{{d.lisRtName}}</div>
{{# }}}
</script>

<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
 

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript" src="../../res/js/rawstockType/rawstockType.js"></script>
</body>
</html>